import { App } from "vue"

export default(app:App<Element>):void => {
  app.directive("preventClick",{
    mounted(elem,binding) {
      elem.addEventListener("click",() => {
        if(!elem.disabled) {
          elem.classList.add("is-disabled")
          elem.disabled = true
          setTimeout(() => {
            elem.classList.remove("is-disabled")
            elem.disabled = false
          },3000)
        }
      })
    }
  })
}